export function lookUp(obj, path) {
    let result;

    if (!isDot(path)) {
        const keys = path.split('.');

        result = keys.reduce((pre, cur) => {
            return pre[cur];
        }, obj);
    } else {
        result = obj;
    }

    return result;
}

export function compressDomStr(domStr) {
    return domStr.replace(/>(\s+.*\s+) | (\s+.*) | (.*\s+)</g, findStr => {
        return findStr.replace(/\s/g, '');
    });
}

function isDot(str) {
    return str === '.';
}